'use strict';
/**
 * Created by deng on 16-1-19.
 */
angular.module('metalabOperationApp').config(['$stateProvider', function ($stateProvider) {

    $stateProvider
        .state('meta.permission.demand', {
            url: '/demand',
            abstract: true,
            views: {
                'content': {
                    templateUrl: 'views/permission/common/content.html'
                }
            }
        }).state('meta.permission.demand.user', {
            url: '/user',
            abstract: true
        }).state('meta.permission.demand.user.list', {
            url: '/list?area&fund&rank&province&manager&state&page&sort&search&value&showAll',
            views: {
                'header@meta.permission.demand': {
                    templateUrl: 'views/permission/demand/header.html',
                    controller: 'HeaderCtrl'
                },
                'body@meta.permission.demand': {
                    templateUrl: 'views/permission/demand/user/index.html',
                    controller: 'DemandListCtrl'
                },
                'page@meta.permission.demand.user.list': {
                    templateUrl: 'views/permission/common/page.html'
                },
                //filter
                'meta-area-control@meta.permission.demand.user.list': {
                    templateUrl: 'views/permission/filter/area.html'
                },
                'meta-fund-control@meta.permission.demand.user.list': {
                    templateUrl: 'views/permission/filter/fund.html'
                },
                'meta-rank-control@meta.permission.demand.user.list': {
                    templateUrl: 'views/permission/filter/rank.html'
                },
                'meta-province-control@meta.permission.demand.user.list': {
                    templateUrl: 'views/permission/filter/province.html'
                },
                'meta-manager-control@meta.permission.demand.user.list': {
                    templateUrl: 'views/permission/filter/manager.html'
                },
                'meta-state-control@meta.permission.demand.user.list': {
                    templateUrl: 'views/permission/filter/demandState.html'
                },
                'meta-created-control@meta.permission.demand.user.list': {
                    templateUrl: 'views/permission/filter/created.html'
                },
                'meta-verified-control@meta.permission.demand.user.list': {
                    templateUrl: 'views/permission/filter/verified.html'
                },
                //search
                'meta-search@meta.permission.demand.user.list': {
                    templateUrl: 'views/permission/common/search.html'
                }
            }
        }).state('meta.permission.demand.user.detail', {
            url: '/detail/:id',
            views: {
                'header@meta.permission.demand': {
                    templateUrl: 'views/permission/demand/header.html',
                    controller: 'HeaderCtrl'
                },
                'body@meta.permission.demand': {
                    templateUrl: 'views/permission/common/detail.html',
                    controller: 'DemandDetailEditCtrl'
                },
                'edit@meta.permission.demand.user.detail':{
                    templateUrl: 'views/permission/demand/edit.html'
                },
                'control@meta.permission.demand.user.detail':{
                    templateUrl: 'views/permission/demand/control.html'
                },
                'comment@meta.permission.demand.user.detail':{
                    templateUrl: 'views/permission/common/comment.html'
                }
            }
        }).state('meta.permission.demand.cooperation', {
            url: '/cooperation',
            abstract: true
        }).state('meta.permission.demand.cooperation.list', {
            url: '/list?area&fund&province&manager&state&page&sort&search&value&showAll',
            views: {
                'header@meta.permission.demand': {
                    templateUrl: 'views/permission/technology/header.html',
                    controller: 'HeaderCtrl'
                },
                'body@meta.permission.demand': {
                    templateUrl: 'views/permission/demand/cooperation/index.html',
                    controller: 'DemandListCtrl'
                },
                'page@meta.permission.demand.cooperation.list': {
                    templateUrl: 'views/permission/common/page.html'
                },
                //filter
                'meta-area-control@meta.permission.demand.cooperation.list': {
                    templateUrl: 'views/permission/filter/area.html'
                },
                'meta-fund-control@meta.permission.demand.cooperation.list': {
                    templateUrl: 'views/permission/filter/fund.html'
                },
                'meta-rank-control@meta.permission.demand.cooperation.list': {
                    templateUrl: 'views/permission/filter/rank.html'
                },
                'meta-province-control@meta.permission.demand.cooperation.list': {
                    templateUrl: 'views/permission/filter/province.html'
                },
                'meta-manager-control@meta.permission.demand.cooperation.list': {
                    templateUrl: 'views/permission/filter/manager.html'
                },
                'meta-state-control@meta.permission.demand.cooperation.list': {
                    templateUrl: 'views/permission/filter/demandState.html'
                },
                'meta-created-control@meta.permission.demand.cooperation.list': {
                    templateUrl: 'views/permission/filter/created.html'
                },
                'meta-verified-control@meta.permission.demand.cooperation.list': {
                    templateUrl: 'views/permission/filter/verified.html'
                },
                //search
                'meta-search@meta.permission.demand.cooperation.list': {
                    templateUrl: 'views/permission/common/search.html'
                }
            }
        }).state('meta.permission.demand.cooperation.detail', {
            url: '/detail/:id',
            views: {
                'header@meta.permission.demand': {
                    templateUrl: 'views/permission/technology/header.html',
                    controller: 'HeaderCtrl'
                },
                'body@meta.permission.demand': {
                    templateUrl: 'views/permission/common/detail.html',
                    controller: 'DemandDetailEditCtrl'
                },
                'edit@meta.permission.demand.cooperation.detail':{
                    templateUrl: 'views/permission/demand/edit.html'
                },
                'control@meta.permission.demand.cooperation.detail':{
                    templateUrl: 'views/permission/demand/control.html'
                },
                'comment@meta.permission.demand.cooperation.detail':{
                    templateUrl: 'views/permission/common/comment.html'
                }
            }
        }).state('meta.permission.demand.recommend', {
            url: '/recommend',
            views: {
                'header@meta.permission.demand': {
                    templateUrl: 'views/permission/demand/header.html',
                    controller: 'HeaderCtrl'
                },
                'body@meta.permission.demand': {
                    templateUrl: 'views/permission/demand/recommend/index.html'
                }
            }
        });

}]);
